<template>
  <el-dialog title="新增/编辑" :close-on-click-modal="false" append-to-body :visible.sync="visible" class="cu-dialog cu-dialog_center" lock-scroll width="880px">
    <el-row :gutter="15" class="">
      <el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" :rules="rules">
        <el-col :span="24">
          <el-form-item label-width="0">
            <groupTitle content-position="left" content="校区信息"></groupTitle>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="校区品牌" prop="brand">
            <el-select v-model="dataForm.brand" placeholder="请选择校区品牌" filterable clearable required :style="{ width: '100%' }">
              <el-option :key="item.id" :label="item.fullName" :value="item.enCode" v-for="item in brandOptions" />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="校区名称" prop="campusId">
            <el-select v-model="dataForm.campusId" v-if="dataForm.brand !== 'other'" placeholder="请选择校区名称" filterable clearable required :style="{ width: '100%' }">
              <el-option v-for="(item, index) in campusOptions" :key="index" :label="item.fullName" :value="item.id"></el-option>
            </el-select>
            <el-input v-else v-model="dataForm.campusId" placeholder="请输入校区名称" clearable required :style="{ width: '100%' }"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12" v-if="dataForm.brand !== 'other'">
          <el-form-item label="校区编码" prop="enCode">
            <el-input v-model="dataForm.enCode" placeholder="请输入校区编码" clearable required :style="{ width: '100%' }" :disabled="dataForm.brand !== 'other'"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="负责人" prop="manager" v-if="dataForm.brand !== 'other'">
            <el-input v-model="dataForm.manager" placeholder="请输入负责人" clearable required :style="{ width: '100%' }" :disabled="dataForm.brand !== 'other'"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="联系电话" prop="managerMobile" v-if="dataForm.brand !== 'other'">
            <el-input v-model="dataForm.managerMobile" placeholder="请输入联系电话" clearable required :style="{ width: '100%' }" :disabled="dataForm.brand !== 'other'"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="系统状态" prop="CampusStatus" v-if="dataForm.brand !== 'other'">
            <el-select v-model="dataForm.CampusStatus" placeholder="请选择系统状态" filterable clearable required :style="{ width: '100%' }" :disabled="dataForm.brand !== 'other'">
              <el-option :key="item.enCode" :label="item.fullName" :value="item.enCode" v-for="item in CampusStatusOptions" />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="所在区域" prop="area">
            <custom-address v-model="dataForm.area" :placeholder="'请选择所在区域'" clearable required :disabled="dataForm.brand !== 'other'"></custom-address>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="机构名称" prop="businessName">
            <el-input v-model="dataForm.businessName" placeholder="请输入营业执照" clearable required :style="{ width: '100%' }" :disabled="dataForm.brand !== 'other'"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="营业执照" prop="businessPic">
            <custom-upload-img :type="'businessPic'" v-model="dataForm.businessPic" :fileSize="500" sizeUnit="MB" :limit="1" :disabled="dataForm.brand !== 'other'"></custom-upload-img>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="详细地址" prop="address">
            <el-input v-model="dataForm.address" placeholder="请输入详细地址" clearable required :style="{ width: '100%' }" :disabled="dataForm.brand !== 'other'"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label-width="0">
            <groupTitle content-position="left" content="事项描述"></groupTitle>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="违规事项" prop="violationIssue">
            <el-select v-model="dataForm.violationIssue" placeholder="请选择违规事项" filterable clearable required :style="{ width: '100%' }">
              <el-option :key="item.enCode" :label="item.fullName" :value="item.enCode" v-for="item in violationlssueOptions" />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="违规说明" prop="description">
            <el-input v-model="dataForm.description" placeholder="请输入违规说明" show-word-limit :style="{ width: '100%' }" type="textarea" :autosize="{ minRows: 4, maxRows: 4 }"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="上传附件" prop="attachments">
            <custom-upload-fz type="summarize" v-model="dataForm.attachments" :fileSize="500" sizeUnit="MB" :limit="9" buttonText="点击上传文件" :style="{ width: '300px' }"></custom-upload-fz>
          </el-form-item>
        </el-col>
      </el-form>
    </el-row>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">取 消</el-button>
      <el-button type="primary" @click="dataFormSubmit()" :loading="loading">确 定</el-button>
    </span>
  </el-dialog>
</template>
<script>
export { default } from './index.js'
</script>
